<%@ page import="java.util.ArrayList" %>
<%@ page import="com.bean.Articletype" %><%--
  Created by IntelliJ IDEA.
  User: 九号
  Date: 2022/3/28
  Time: 23:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <title>博客后台-文章列表</title>
    <link href="${pageContext.request.contextPath}/admin/css/home.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript">
        //添加商品
        function addArtice() {
            window.location.href = "${pageContext.request.contextPath}/admin/article/ArticleAdd.jsp";
        }
        //删除文章
        function p_del() {
            var msg = "您确定要删除该文章吗？";
            if (confirm(msg)==true){
                return true;
            }else{
                return false;
            }
        }
        // confirmTrans: function(){
        //     //配置一个透明的询问框
        //     layer.msg('大部分参数都是可以公用的<br>合理搭配，展示不一样的风格', {
        //         time: 20000, //20s后自动关闭
        //         btn: ['明白了', '知道了', '哦']
        //     });
        // }
    </script>
</head>

<body>

    <jsp:include page="/admin/login/top.jsp"/>
<div class="main">
    <jsp:include page="/admin/login/left.jsp"/>
<div class="home">
    <br />
<form id="article_MG" name="article_MG" action="/ListType" method="post">
    <table cellspacing="1" cellpadding="0" width="100%" align="center" border="0">
        <TBODY>
<tr>
    <td class="ta_01" align="center" bgColor="#CEADE2">
        <strong>文 章 列 表</strong>
    </td>
</tr>
        <tr>
            <td class="ta_01" align="right">
                <button type="button" id="add" name="add" value="&#28155;&#21152;" class="button_add" onclick="addArtice()">
                    &#28155;&#21152;
                </button>
            </td>
        </tr>
        <tr>
            <td class="ta" align="center" bgColor="#f5fafe">
                <table cellspacing="0" cellpadding="1" rules="all"
                       bordercolor="gray" border="1" id="DataGrid1"
                       style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">
                    <tr style="FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #ceade2">
                        <%--<td width="8%" align="center">ID</td>--%>
                        <td align="center" width="24%">文章标题</td>
                        <td align="center" width="9%">创建时间</td>
                        <td align="center" width="9%">分类</td>
                        <td width="8%" align="center">浏览量</td>
                        <td width="8%" align="center">点赞量</td>
                        <td width="8%" align="center">查看文章</td>
                        <td width="8%" align="center">删除</td>
                    </tr>
                    <!--  循环输出所有商品 -->
                    <c:forEach items="${listarticle}" var="p">
                        <tr onmouseover="this.style.backgroundColor = 'white'"
                            onmouseout="this.style.backgroundColor = '#fdf8f8';">
                           <%-- <td style="CURSOR: hand; HEIGHT: 22px" align="center" width="200">13</td>--%>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center" width="18%">${p.title}</td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center" width="8%">${p.pubtime}</td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center" width="8%">${p.typename}</td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center" width="8%">${p.count}</td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center" width="8%">1</td>
                            <td align="center" style="HEIGHT: 22px" width="7%">
                                <a href="${pageContext.request.contextPath}/findArticleById?id=${p.id}">
                                    <img src="${pageContext.request.contextPath}/admin/images/i_edit.gif" border="0" style="CURSOR: hand">
                                </a>
                            </td>
                            <td align="center" style="HEIGHT: 22px" width="7%">
                                <a href="${pageContext.request.contextPath}/deleteArticle?title=${p.title}" onclick="javascript:return p_del()">
                                    <img src="${pageContext.request.contextPath}/admin/images/i_del.gif"
                                         width="16" height="16" border="0" style="CURSOR: hand">
                                </a>
                            </td>
                        </tr>
                    </c:forEach>
                </table>
            </td>
        </tr>
        </tr>
        </TBODY>
    </table>
</form>
</div>
</div>
</body>
<jsp:include page="/admin/login/bottom.jsp"/>
</html>